-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improved Negative Prompt Support for Anime, Paintings and Other Non-Photographic Media #2481 #2492
Conversation
In anime.json, at Line 36, replace "Fooocus Negative" with "Fooocus Semi Realistic"
In sdxl_styles_fooocus.json, insert this text at Line 6: { "name": "Fooocus Semi Realistic", "negative_prompt": "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)" },
Popup image for the new "Fooocus Semi Realistic" style
Removed "grayscale, bw" from the proposed Fooocus Realistic entry at Line 6 of sdxl_styles_fooocus.json
After further thought, I removed "grayscale, bw," from the proposed Fooocus Semi Realistic style that I added to sdxl_styles_fooocus.json. This was done in Commit #5. I think this new negative style should be as generic as possible because it has useful suppression such as "signature", "bad anatomy" and "out of frame" that would benefit sketches, black & white photos and greyscale printing - as well as the anime and paintings that I was focused on earlier. Many of the genre specific styles such as SAI Anime already have "black and white" in the negative prompt already, and others such as Artstyle Impressionist have "color" in the positive prompt. If the user occasionally has to add "black and white" manually to a negative prompt I would think that would be preferable than trying to list many of the other beneficial negatives that are in found Fooocus Semi Realistic. I made a mistake while I was trying to figure out how to revise a PR. Commit #4 removes sdxl_styles_fooocus.json completely. This commit should obviously be deleted, but I haven't been able to discover how to do that. My apologies! |
Oh dear, now I think I closed the whole PR! Hopefully this will reopen it. |
juggernautv8, seed 0, 1024x1024, no LoRAs, only this style, positive prompt "cat"
Hey @DavidDragonsage, thank you for your first contribution, which is especially well documented! Comparison (metadata in images, compared between same seeds): We can conclude that this PR delivers real benefit to users when generating anime / semi-realistic images. |
Thank you, @mashb1t, I appreciate the encouragement! Do you need a different cat thumbnail using the criteria mentioned above: I rather liked my first cat thumbnail, but I don't mind making another one if that's not the standard. :-) |
@DavidDragonsage no need, i've alread created a new one with standard criteria |
Thank you, yes I just found it was already there just now. I was just about to commit the same version of the little beast. :) I can appreciate why they should all be standardized with the same model and seed, that gives the maximum consistency. I was intrigued by the study you made with the four anime subjects. It seemed that the new negative style allowed for a little more ornamentation. I'm always fascinated that even negative prompts can create stylistic variations. It makes sense, but it still seems surprising to me. |
Reference: Improved Negative Prompt Support for Anime, Paintings and Other Non-Photographic Media #2481
INTRODUCTION:
Currently the Anime preset uses Fooocus Negative in its default_styles list. This is an unfortunate choice in that Fooocus Negative suppresses "anime", as well as "drawing, painting, crayon, sketch, graphite, impressionist, noisy... cartoon, graphic, text, painting, crayon, graphite, abstract" (yes, "painting" is listed twice).
Fooocus Enhance is a somewhat better choice for non-photographic negative prompting in that it does not suppress "painting", but it does have "(airbrushed, cartoon, anime, semi-realistic, cgi, render, blender, digital art, manga, amateur:1.3), (3D ,3D Game, 3D Game Scene, 3D Character:1.1)" in its no-fly zone.
Apart from that, Fooocus Enhance contains a lot of suppression that is really valuable for semi-realistic art, such as "bad anatomy", "watermark", "cropped", etc.
My proposal is to have a version of the Fooocus Enhance style in which the words "airbrushed" through to "3D Character" are removed. This new style could be called "Fooocus Semi Realistic".
PROCEDURE:
Modify or add the following components, as follows:
In sdxl_styles_fooocus.json, insert this text at Line 6:
{
"name": "Fooocus Semi Realistic",
"negative_prompt": "(worst quality, low quality, normal quality, lowres, low details, oversaturated, undersaturated, overexposed, underexposed, grayscale, bw, bad photo, bad photography, bad art:1.4), (watermark, signature, text font, username, error, logo, words, letters, digits, autograph, trademark, name:1.2), (blur, blurry, grainy), morbid, ugly, asymmetrical, mutated malformed, mutilated, poorly lit, bad shadow, draft, cropped, out of frame, cut off, censored, jpeg artifacts, out of focus, glitch, duplicate, (bad hands, bad anatomy, bad body, bad face, bad teeth, bad arms, bad legs, deformities:1.3)"
},
In anime.json, at Line 36,
replace "Fooocus Negative" with "Fooocus Semi Realistic"
a) Use run_anime.bat to start Fooocus with the anime preset
b) Select 1024x1024 for a square aspect ratio
c) Deselect all styles except "Fooocus Semi Realistic"
d) Enter "cat" as the positive prompt
e) Generate
f) Select an appropriate image and use IrfranView to resize to 128x128
g) Save as fooocus_semi_realistic.jpg
TESTING:
Start Fooocus with the anime preset. The Style selections correctly display Fooocus V2, Fooocus Semi Realistic and Fooocus Masterpiece as the defaults. See "fooocus style selector - Semi Realistic.png." This image capture was taken after the creation of fooocus_semi_realistic.jpg and correctly displays the popup for the new style.
After deselecting Fooocus V2 and Fooocus Masterpiece, "Semi Realistic Log Data.png" correctly shows the Fooocus Semi Realistic style selection, and "Semi Realistic Metadata.png" shows that the Fooocus Semi Realistic was correctly used as the full_negative prompt.
ATTACHMENTS:
"Improved Support for Anime & Paintings.zip" contains the amended sdxl_styles_fooocus.json, anime.json, and fooocus_semi_realistic.jpg, as well as supporting documentation.
Improved Support for Anime & Paintings.zip